package lesson2;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 19.03.14
 * Time: 21:34
 * To change this template use File | Settings | File Templates.
 */
public class Classwork4 {

    @Test
    public void test() throws Exception {
        WebDriver driver = new FirefoxDriver();
        StringBuffer verificationErrors = new StringBuffer();
        String baseUrl = "http://rozetka.com.ua";
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);


        driver.get(baseUrl);
        //driver.findElement(By.xpath("//span[contains(text(),'Телефоны, MP3, GPS')]")).click();
        //
        driver.findElement(By.xpath("//span[contains(text(),'Телефоны, MP3, GPS')]/ancestor::id='computers-notebooks'")).click();
        driver.quit();
}
}
